import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;

public class Demo {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();
        Map<Character,Integer> map = new HashMap<>();

        for(int i = str.length() - 1 ; i >= 0; i--) {
            char ch = str.charAt(i);

            if(map.get(ch) == null) {
                map.put(ch,1);
            }else {
                map.put(ch,map.get(ch) + 1);
            }
        }

        boolean fly = false;
        Set<Map.Entry<Character,Integer>> entry = map.entrySet();
        for(Map.Entry<Character,Integer> set:entry) {
            if(set.getValue() == 1) {
                System.out.println(set.getKey());
                fly = true;
                break;
            }
        }

        if(!fly) {
            System.out.println(-1);
        }
    }
}
